package com.sinai.mshab.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.ui.FlexTable;
import com.google.gwt.user.client.ui.HasVerticalAlignment;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.MultiWordSuggestOracle;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.SuggestBox;
import com.google.gwt.user.client.ui.TextBox;
import com.sinai.mshab.client.formatting.Direction;
import com.sinai.mshab.client.util.MshabImageBundle;
import com.sinai.mshab.client.widgets.ExpandableTable;
import com.sinai.mshab.client.widgets.FormatPanel;
import com.sinai.mshab.client.widgets.NotifyPanel;
import com.sinai.mshab.client.widgets.OrderedList;

/**
 * Entry point classes define <code>onModuleLoad()</code>.
 */
public class Mshab implements EntryPoint {

	/**
	 * The image bundle we are using for most of the icons.
	 */
	private static MshabImageBundle imageBundle = GWT
			.create(MshabImageBundle.class);

	/**
	 * This is the entry point method.
	 */
	public void onModuleLoad() {

//		ExpandableTable table = new ExpandableTable("Hey?");
//		table.includeRemoveLinks();
//		table.add(new Label("Hey"));
//		RootPanel.get().add(table);
		
		
		// FormatPanel panel = new FormatPanel();
		//		
		// TextBox email = new TextBox();
		//		
		// panel.add(email);
		// panel.setRequired(email);
		// panel.setValidator(email, "\\d+", "numbers only please");
		//		
		//		
		// RootPanel.get().add(panel);

		//
		// NotifyPanel infoNotify = new NotifyPanel("This is some info");
		// infoNotify.infoMode();
		//
		// NotifyPanel warnNotify = new NotifyPanel("This is a warning");
		// warnNotify.warningMode();
		//
		// NotifyPanel errorNotify = new NotifyPanel("This is an error");
		// errorNotify.errorMode();
		//
		// NotifyPanel custom = new NotifyPanel("This is some info");
		// custom.setIcon("images/add.gif");
		//
		// NotifyPanel infoPanel = new NotifyPanel(
		// "This is some info with background");
		// infoPanel.infoMode();
		// infoPanel.showBackground();
		//
		// NotifyPanel warnPanel = new NotifyPanel(
		// "This is a warning with background");
		// warnPanel.warningMode();
		// warnPanel.showBackground();
		//
		// NotifyPanel errorPanel = new NotifyPanel(
		// "This is an error with background");
		// errorPanel.errorMode();
		// errorPanel.showBackground();
		//
		// panel.add(infoNotify);
		// panel.addBreak();
		// panel.add(warnNotify);
		// panel.addBreak();
		// panel.add(errorNotify);
		// panel.addBreak();
		// panel.add(custom);
		// panel.addBreak();
		// panel.add(infoPanel);
		// panel.addBreak();
		// panel.add(warnPanel);
		// panel.addBreak();
		// panel.add(errorPanel);

		// FlexTable panel = new FlexTable();
		// panel.setWidget(0,0,new Label("Grr"));
		// panel.setWidget(0,1, new Label("Grr2!"));
		// panel.getCellFormatter().setVerticalAlignment(0, 0,
		// HasVerticalAlignment.ALIGN_MIDDLE);
		// panel.getCellFormatter().setVerticalAlignment(0, 1,
		// HasVerticalAlignment.ALIGN_MIDDLE);

		// RootPanel.get().add(panel);

		//		
		// FormatPanel panel = new FormatPanel();
		// panel.setDefaultLabelPosition(Direction.TOP);
		//		
		// TextBox email = new TextBox();
		// panel.add(email);
		// panel.setRequired(email);
		// panel.setLabel(email, "Email:");
		// panel.setValidator(email, "..+@..+\\...+", "please enter valid email
		// address");
		//		
		// String stuff[] = {"item one", "another item", "Something entirely
		// useless"};
		// OrderedList list = new OrderedList(stuff);
		// panel.add(list);
		//		
		// RootPanel.get().add(panel);
		//		

		// ExpandableTable table = new ExpandableTable("Add another?");
		// table.includeRemoveLinks();
		// panel.add(table);
		// table.add(new TextBox());
		// panel.setLabel(table, "Stuff");
		// RootPanel.get().add(panel);

		// LazyTabPanel panel = new LazyTabPanel();
		//		
		// Label tab1, tab2, content1, content2;
		// tab1= new Label("tab1");
		// tab2= new Label("tab2");
		// content1= new Label("content1");
		// content2= new Label("contenet2");
		//		
		// panel.add(content1, tab1);
		// panel.add(content2, tab2);
		//		
		// TabBar bar = new TabBar();

		// p

		// panel

		// RootPanel.get().add(panel);
		//		
		// panel.add(new VerticalPanel(), new Label("Hey"));
		// panel.add(new LoginPage("Login", "stuff", null), "Hey22");
		// panel.selectTab(0);
		//		
		// RootPanel.get().add(panel);

		// // fake DB structure
		// DatabaseStructure struct = new DatabaseStructure();
		// struct.addField("Person", new Field("first_name", "varchar"));
		// struct.addField("Person", new Field("last_name", "varchar"));
		// struct.addField("Person", new Field("age", "int"));
		// struct.addField("Person", new Field("date_of_birth", "date"));
		// struct.addField("Perscription", new Field("type", "varchar"));
		// struct.addField("Perscription", new Field("issued_on", "date"));
		//		
		// AdvancedSearch search = new AdvancedSearch(struct, "policy_id");
		// RootPanel.get().add(new Button("Hello"));
	}

	public static MshabImageBundle getImageBundle() {
		return imageBundle;
	}
}
